<include file="public/header"/>
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body wrapper wrapper-content animated fadeInRight">
                <div class="row">
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title">
                                <h5>批量导入数据</h5>
                            </div>

                            <div class="ibox-content">
                                <form class="form-horizontal m-t" id="signupForm" action="{:url('upload_excel')}" method="post" enctype="multipart/form-data">

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label-left">选择Excel文件：</label>
                                        <div class="col-sm-8">
                                            <!-- 真正的文件上传表单 -->
                                            <input name="file" type="file" id="thisfile"  style="display: none" />



                                            <div class="input-group">
                                                <input type="text" class="form-control" id="showname" readonly>
                                                <span class="input-group-btn">
                                                    <button type="button" class="btn btn-primary" id="browse" onclick="makeThisfile()" >选择文件</button>
                                                    </span>
                                            </div>


                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label-left"></label>
                                        <div class="col-sm-8">
                                            <a href="/download.php?path=static/import_product.xlsx&name=import_product.xlsx"><span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 点击下载示范Excel文件</span></a>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-8 col-sm-offset-3">
                                            <button class="btn btn-primary" id="edit" type="submit">提交</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


<script src="__TMPL__/public/assets/js/jquery.min.js?v=2.1.4"></script>
<script src="__TMPL__/public/assets/js/bootstrap.min.js?v=3.3.5"></script>
<script src="__TMPL__/public/assets/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="__TMPL__/public/assets/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="__TMPL__/public/assets/js/plugins/layer/layer.min.js"></script>
<script src="__TMPL__/public/assets/js/hplus.min.js?v=4.0.0"></script>
<script type="text/javascript" src="__TMPL__/public/assets/js/contabs.min.js"></script>
<script src="__TMPL__/public/assets/js/plugins/pace/pace.min.js"></script>
<script src="__TMPL__/public/assets/js/content.min.js"></script>
<!-- Peity -->
<script src="__TMPL__/public/assets/js/plugins/peity/jquery.peity.min.js"></script>

<!-- iCheck -->
<script src="__TMPL__/public/assets/js/plugins/iCheck/icheck.min.js"></script>
<script src="__TMPL__/public/assets/js/plugins/sweetalert/sweetalert.min.js"></script>
<script type="text/javascript">
    //触发隐藏的file表单
    function makeThisfile(){
        $('#thisfile').click();
    }

    //file表单选中文件时,让file表单的val展示到showname这个展示框
    $('#thisfile').change(function(){
        $('#showname').val($(this).val())
    })
</script>
<script>

    $(document).ready(function () {
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });
    });

</script>
<script>
    function confirmdeletedata(id)
    {
        swal({
            title: "确定要删除数据?",
            text: "确认将删除该条数据!",
            type: "warning",
            showCancelButton: true,
            confirmButtonText: "确认",
            cancelButtonText: '取消',
            closeOnConfirm: false
        }, function(){
            $.post('{:url("delPukanRow")}', {'id':id}, function(data) {
                if(data.sta == -1 ){
                    swal({
                        title: "权限不足",
                        text: "",
                        type: "error"
                    });
                }else if(data.sta == 1){
                    swal({
                        title: "删除成功",
                        text: "",
                        type: "success"
                    });
                    window.location.reload();
                }else{
                    swal({
                        title: "删除失败",
                        text: "",
                        type: "error"
                    });
                }
            });
        });
    }

    function addclothes(code,id)
    {
        swal({
            title: "确定要补货吗?",
            text: "确认将提交到行政部门!",
            type: "warning",
            showCancelButton: true,
            confirmButtonText: "确认",
            cancelButtonText: '取消',
            closeOnConfirm: false
        },function(){
            $.post('{:url("index/shop/addClothesForAjax")}', {code: code,id:id}, function(data) {
                if(data.status == 1){
                    swal({ title: ""+data.msg+"",text: "",type: "success"});
                    window.location.reload();
                }else{
                    swal({ title: "申请失败",text: ""+data.msg+"",type: "error"});
                }
            });
        });
    }
</script>
